-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
40 lines (26 loc) · 822 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int n, tam, tamS, tamT;
String s, t, new_string;
n = sc.nextInt();
for (int i = 0; i < n; i++) {
s = sc.next();
t = sc.next();
tamS = s.length();
tamT = t.length();
new_string = "";
tam = s.length() >= t.length() ? tamS : tamT;
for (int j = 0; j < tam; j++) {
if (j < tamS)
new_string += s.charAt(j);
if (j < tamT)
new_string += t.charAt(j);
}
System.out.println(new_string);
}
sc.close();
}
}